import Answer from '@/views/layout/Answer.vue'
import Exam from '@/views/layout/Exam.vue'
import ExamRank from '@/views/layout/ExamRank.vue'
import Home from '@/views/layout/home.vue'
import Message from '@/views/layout/Message.vue'
import My from '@/views/layout/My.vue'
import MyExam from '@/views/layout/MyExam.vue'
import Question from '@/views/layout/Question.vue'
import Login from '@/views/login.vue'
import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/home'
  },
    {
      path: '/login',
      component: Login,
    },
    {
      path: '/home',
      component: Home,
      redirect:'/home/question',
      children: [
        {
          path: 'exam',
          component: Exam,
          meta: { bannerShow:true}
        }, {
          path: 'question',
          component: Question,
          meta: { bannerShow:true}
          
        },
        {
          path: 'user/exam',
          component: MyExam,
          meta: { bannerShow:false}
        },
        {
          path: 'user/my',
          component: My,
          meta: { bannerShow:false}
        },
          {
          path: 'user/message',
          component: Message,
          meta: { bannerShow:false}
        },
        {
          path: 'exam/rank',
          component: ExamRank,
          meta: { bannerShow:false}
          
          }
      ]
    },
    {
      path: '/answer',
      component:Answer
    }
  ],
})

export default router
